<?php
    apf_require_class("PageHelper");
    $img_path = '/img/home/';
    ?>

<div class="header">
    <div class="bg_top"></div>
    <div class="logo"></div>
</div>
<div class="container">
    <h3>新员工档案录入</h3>
    <form id="form1" action="" method="post">
        <ul>
            <li>
                <label>姓名<em>*</em>：</label>
                <input type="text"  name="real_name" value="<?php echo $user['real_name'];?>"/>
                <?php if(isset($error['real_name'])){?><label for="real_name" generated="true" class="error">请填写姓名</label><?php }?>
            </li>

            <li>
                <label>英文名：</label>
                <input type="text"  name="english_name" value="<?php echo $user['english_name'];?>"/>
            </li>

            <li>
                <label>性别<em>*</em>：</label>
                <input type="radio" value="1" name="sex"  style="width: auto;" <?php if($user['sex']==1){?>checked<?php }?>/>男
                <input type="radio" value="2" name="sex" style="width: auto;margin-left: 35px;" <?php if($user['sex']==2){?>checked<?php }?>/>女
            </li>

            <li>
                <label>手机<em>*</em>：</label>
                <input type="text"  name="cellphone" value="<?php echo $user['cellphone'];?>"/>
                <?php if(isset($error['cellphone'])){?><label for="cellphone" generated="true" class="error">请输入正确手机号码</label><?php }?>
            </li>

            <li>
                <label>证件类型<em>*</em>：</label>
                <input type="radio" value="1" id="identity" name="identity_type" style="width: auto;" <?php if($user['identity_type']!=2){?>checked<?php }?>/>身份证
                <input type="radio" value="2" id="passport" name="identity_type" style="width: auto;margin-left: 15px;" <?php if($user['identity_type']==2){?>checked<?php }?>/>护照

            </li>

            <li>
                <label>证件号码<em>*</em>：</label>
                <input type="text" style="width: 200px;" value="<?php echo $user['identity_code'];?>" name="identity_code" maxlength="30"/>
            </li>

            <li>
                <label>报到日期<em>*</em>：</label>
                <input type="text" value="<?php echo $user['entry_date'];?>" class="datepicker" name="entry_date" id="entry_date" maxlength="10"/>
                <?php if(isset($error['entry_date'])){?><label for="entry_date" generated="true" class="error">请输入报到日期</label><?php }?>
            </li>

            <li>
                <label>签约合同城市<em>*</em>：</label>
                <select name="city_id">
                    <option value="">请选择</option>
                    <?php foreach($agree_city as $city){?>
                        <option value="<?php echo $city['city_id'];?>" <?php if($city['city_id'] == $user['city_id'] || ( !$user['city_id'] && $city['city_id']==$operator_city_id)){?>selected="selected"<?php }?>><?php echo $city['city_name'];?></option>
                    <?php }?>
                </select>
                <?php if(isset($error['city_id'])){?><label for="city_id" generated="true" class="error">请选择签约城市</label><?php }?>
            </li>

            <li>
                <label>员工类型<em>*</em>：</label>
                <select name="user_type">
                <option value="">请选择</option>
                    <?php foreach($user_type as $type){?>
                        <option value="<?php echo $type['type_id'];?>" <?php if($type['type_id'] == $user['user_type'] || (!$user['user_type'] && $type['type_id']==1)){?>selected="selected"<?php }?>><?php echo $type['type_name'];?></option>
                    <?php }?>
                </select>
                <?php if(isset($error['user_type'])){?><label for="user_type" generated="true" class="error">请选择员工类型</label><?php }?>
            </li>

            <li>
                <label>担任职位<em>*</em>：</label>
                <input type="text" style="width:240px;" name="job_name" value="<?php echo $user['job_name'];?>"/>
                <input type="hidden"  class="position_id" name="job_id" value="<?php echo $user['job_id'];?>"/>
                <input type="hidden"  class="position_city" name="work_city_id" value="<?php echo $user['work_city_id'];?>"/>
                <?php if(isset($error['job_id'])){?><label for="job_name" generated="true" class="error">请选中己存在的职位</label><?php }?>
            </li>

            <li>
                <label>直属上级<em>*</em>：</label>
                <input type="text" style="width:240px;" name="parent_name" value="<?php echo $user['parent_name'];?>"/>
                <input type="hidden" class="leader_id" name="parent_id" value="<?php echo $user['parent_id'];?>"/>
                <input type="hidden"  class="leader_job"  name="parent_job_id" value="<?php echo $user['parent_job_id'];?>"/>
                <?php if(isset($error['parent_id'])){?><label for="parent_name" generated="true" class="error">请选中己存在的职位</label><?php }?>
            </li>

            <li>
                <label></label>
                <input class="submit" type="submit" value=""/>
                <input type="submit" id="save_a" class="save_a" value="保存并继续添加"/>
                <input type="hidden" value="1" id="hid_submit" name="submit"/>
                <input type="hidden" value="<?php echo $user['entry_id'];?>" id="entry_id" name="entry_id"/>
                <?php if($user['entry_id']){?>
                    <input type="submit" id="save_b" class="save_a" value="取消入职"/>
                <?php }?>
            </li>


        </ul>




    </form>
    <?php if($notice){?>
        <label id="msg" style="display: inline-block;position: absolute;color: green;top:97px;right:350px;font-size: 20px;"><?php if($notice == "add"){?>添加成功<?php }else{?>修改成功<?php }?></label>
    <?php }?>
</div>
<div class="footer">
</div>
<?php $this->script_block_begin(); ?>
<script type="text/javascript">
var url_user = "<?php echo Portal_Urls::ajax_search_user();?>";
var url_job = "<?php echo Portal_Urls::ajax_search_job();?>";
var url_identity ="<?=Portal_Urls::ajax_id_card()?>";
</script>
<?php $this->script_block_end(); ?>